//
//  iOSCodeLearningUITests.m
//  iOSCodeLearningUITests
//
//  Created by Ace on 2017/10/31.
//  Copyright © 2017年 Ace. All rights reserved.
//

#import <XCTest/XCTest.h>
#import <Masonry.h>

@interface iOSCodeLearningUITests : XCTestCase

@end

@implementation iOSCodeLearningUITests

- (void)setUp {
    [super setUp];
    
    // Put setup code here. This method is called before the invocation of each test method in the class.
    
    // In UI tests it is usually best to stop immediately when a failure occurs.
    self.continueAfterFailure = NO;
    // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
    [[[XCUIApplication alloc] init] launch];
    
    // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // Use recording to get started writing UI tests.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}


-(void)testLogin{
    
    
    XCUIApplication *app = [[XCUIApplication alloc] init];
    XCUIElement *textField = app.textFields[@"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"];
    [textField tap];
    [textField typeText:@"qqqq"];
    
    XCUIElement *textField2 = app.textFields[@"\u8bf7\u8f93\u5165\u5bc6\u7801"];
    [textField2 tap];
    [textField2 tap];
    [textField2 typeText:@"wwww"];
    
    for (NSInteger i = 0; i<2; i++) {
        [app.buttons[@"\u767b\u5f55"] tap];
    }
}

-(void)testTableView{
    
    XCUIElementQuery *tablesQuery = [[XCUIApplication alloc] init].tables;
    [tablesQuery/*@START_MENU_TOKEN@*/.staticTexts[@"UITestTableView"]/*[[".cells.staticTexts[@\"UITestTableView\"]",".staticTexts[@\"UITestTableView\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
    
    
    [[[tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:7] swipeUp];
    [[[tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:10] swipeDown];
    /*@START_MENU_TOKEN@*/[[[tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:11] swipeRight];/*[["[[","tablesQuery childrenMatchingType:XCUIElementTypeCell] elementBoundByIndex:11]","["," swipeUp];"," swipeRight];"],[[[0,1,1]],[[2,4],[2,3]]],[0,0]]@END_MENU_TOKEN@*/
   
    
    
    
}

@end
